package moble

import (
	"time"
	"video_-chat/global"
)

type LoginLog struct {
	Time  time.Time `gorm:"type:date"`
	Count int64     `gorm:"type:int"`
}

func (l LoginLog) LogSet() {
	count, _ := global.RDB.HLen(global.Ctx, "login_once").Result()
	var log = LoginLog{
		Time:  time.Now(),
		Count: count,
	}
	global.DB.Create(&log)
	global.RDB.Del(global.Ctx, "login_once")
}
